package org.ushio.nchu_22201408.service.Impl;

import org.ushio.common_module.entity.Bill;
import org.ushio.nchu_22201408.mapper.BillMapper;
import org.ushio.nchu_22201408.service.BillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class BillServiceImpl implements BillService {

    private final BillMapper billMapper;

    @Autowired
    public BillServiceImpl(BillMapper billMapper) {
        this.billMapper = billMapper;
    }

    @Override
    public List<Bill> findAllBillsByPhoneNumber(String phoneNumber) {
        return billMapper.findAllBillsByPhoneNumber(phoneNumber);
    }
    @Override
    public Bill createBill(Bill bill) {
        billMapper.insertBill(bill);
        return bill;
    }
}